package cn.lili.controller.feign.wallet;

import cn.lili.modules.payment.client.LiUserPointsWithdrawClient;
import cn.lili.modules.payment.client.RechargeClient;
import cn.lili.modules.payment.entity.dos.LiUserPointsWithdraw;
import cn.lili.modules.payment.service.LiUserPointsWithdrawService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class LiUserPointsWithdrawFeignController implements LiUserPointsWithdrawClient {

    private final LiUserPointsWithdrawService pointsWithdrawService;

    /**
     * 保存提现记录
     *
     * @param pointsWithdraw 提现参数
     * @return 提现记录
     */
    @Override
    public LiUserPointsWithdraw saveWithdraw(LiUserPointsWithdraw pointsWithdraw) {
        pointsWithdrawService.save(pointsWithdraw);
        return pointsWithdraw;
    }

    /**
     * 获取提现数据
     * @param id 数据id
     * @return 提现数据
     */
    @Override
    public LiUserPointsWithdraw getById(String id) {
        return pointsWithdrawService.getById(id);
    }

    @Override
    public Boolean updateById(LiUserPointsWithdraw liUserPointsWithdraw) {
        return pointsWithdrawService.updateById(liUserPointsWithdraw);
    }
}
